<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div>
        <textarea name="" id="command" style="margin: 0px; width: 1004px; height: 292px;"></textarea>
        <button class="start">执行</button><br />
        <textarea class="result" style="margin: 0px; width: 1004px; height: 292px;"></textarea>
    </div>
    <script>
        document.querySelector(".start")["onclick"] = x => {
            var c = `${command.value}`;
            fetch('http://localhost:2133/createFetchScript', {
                "headers": {
                    "content-type": "application/json;charset=UTF-8",
                },
                "body": JSON.stringify({ 'a': c }),
                "method": "POST",
            }).then(res => res.json())
                .then(data => {
                    json = JSON.stringify(data, null, '	');
                    console.log(json);
                    document.querySelector(".result").textContent = json;
                });
        };
    </script>
</body>

</html>